package cn.iocoder.yudao.module.chatgpt.controller.admin.chat.params.chat;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Min;
import java.util.List;

/**
 * @author kindear
 * 聊天参数
 */
@Data
@Schema(description = "聊天参数")
public class ChatParams {
    @Schema(description = "模型", example = "gpt-3.5-turbo")
    private String model = "gpt-3.5-turbo";

    @Schema(description = "消息列表", example = "gpt-3.5-turbo")
    private List<ChatMessage> messages;

    @DecimalMin("0.0")
    @DecimalMax("2.0")
    @Schema(description = "采样温度", example = "1.0")
    // notes: 较高的值（如 0.8）将使输出更加随机，而较低的值（如 0.2）将使其更加集中和确定
    private Double temperature = 1.0;

    @DecimalMin("0.0")
    @DecimalMax("1.0")
    @Schema(description = "核心采样", example = "1.0")
    // notes = "其中模型考虑具有top_p概率质量的令牌的结果。因此，0.1 意味着只考虑包含前 10% 概率质量的结果集",
    private Double top_p = 1.0;

    @Min(1)
    @Schema(description = "结果数",example = "1")
    // notes = "如果需要返回多个结果可以设置 n > 1"
    private Integer n = 1;

    @Schema(description = "当前用户ID",example = "匿名用户")
    // notes = "用于处理滥用行为",
    private String user;
}
